function checkname() {
    var nameReg=/^[\u4E00-\u9FA5]{2,4}$/;
    var nickname = document.getElementById("nickname");
    if (nameReg.test(nickname.value)){
        $("#testname").html("");
        $("#nickname").css("border","1px solid greenyellow")
        return true;
    } else {
        $("#nickname").css("border","1px solid #dcdfe6")
        $("#testname").html("请正确填写姓名！");
        return false;
    }
}
function checkidcard() {
    var IdNumReg=/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
    var IdNum = document.getElementById("idcard");
    if (IdNumReg.test(IdNum.value)){
        $("#testidcard").html("");
        $("#idcard").css("border","1px solid greenyellow")
        return true;
    } else {
        $("#idcard").css("border","1px solid #dcdfe6")
        $("#testidcard").html("请输入正确的身份证号码!");
        return false;
    }
}
function checkphone() {
    var phoneReg=/^1[3|4|5|7|8][0-9]{9}$/;
    var phone = document.getElementById("phone");
    if (phoneReg.test(phone.value)){
        $("#testphone").html("");
        $("#phone").css("border","1px solid greenyellow")
        return true;
    } else {
        $("#phone").css("border","1px solid #dcdfe6")
        $("#testphone").html("请输入正确的年龄！");
        return false;
    }
}


function checkaddress() {
    var addressReg = /^[\u4E00-\u9FA5A-Za-z0-9]{4,16}$/;
    var homeaddress = document.getElementById("address");
    if (addressReg.test(homeaddress.value)){
        $("#testaddress").html("");
        $("#address").css("border","1px solid greenyellow")
        return true;
    } else {
        $("#address").css("border","1px solid #dcdfe6")
        $("#testaddress").html("请输入正确的地址!");
        return false;
    }
}
